function createDivOverlay(zIndex) {
	var canvasContainer = document.createElement('div');
	document.body.appendChild(canvasContainer);
	canvasContainer.style.position = "absolute";
	canvasContainer.style.left = "0px";
	canvasContainer.style.top = "0px";
	canvasContainer.style.width = "100%";
	canvasContainer.style.height = "100%";
	canvasContainer.style.zIndex = zIndex;
//	canvasContainer.style.overflow = "hidden";
	return canvasContainer;
};

function createCanvasOverlay(zIndex) {
	var canvasContainer = this.createDivOverlay(zIndex);

	var canvas = document.createElement('canvas');
	canvas.style.width = $(document).width() + "px";
	canvas.style.height = $(document).height() + "px";
	canvas.width = $(document).width();
	canvas.height = $(document).height();
	canvas.style.overflow = 'visible';
	canvas.style.position = 'absolute';

	canvasContainer.appendChild(canvas);

	return canvas;
};

function createAnchoredCanvasOverlay(zIndex, uiWidth, uiHeight, uiBottom) {
	var canvasContainer = document.createElement('div');
	document.body.appendChild(canvasContainer);
	canvasContainer.style.position = "fixed";
	canvasContainer.style.width = "100%";
	canvasContainer.style.height = uiHeight + "px";
	// canvasContainer.style.left = "50%";
	canvasContainer.style.bottom = uiBottom + "px";
	canvasContainer.style.zIndex = "200";
	canvasContainer.style.margin = "0 auto";
	canvasContainer.style.padding = "0";
	canvasContainer.style.display = "block";

	var canvas = document.createElement('canvas');
	// canvas.style.margin = "0 " + ((canvasContainer.scrollWidth / 2) - (uiWidth /
	// 2)) + "px";
	canvas.style.margin = "0 10px";
	canvas.style.height = uiHeight + "px";
	canvas.style.width = uiWidth + "px";
	// You must set this otherwise the canvas will be streethed to fit the
	// container
	canvas.width = uiWidth;
	canvas.height = uiHeight;
	canvas.style.overflow = 'visible';
	canvas.style.position = 'absolute';
	canvasContainer.appendChild(canvas);

	// this.context.clearRect(0, 0, this.width, this.height);
	// this.context.fillStyle = "rgba(0,200,200,0.5)";
	// this.context.fillRect(0,0, this.width, this.height);
	return canvas;
};